package com.wzy.web;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import javax.servlet.http.HttpServletRequest;

@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {


    @ExceptionHandler(value = Exception.class)
    public Object exceptionHandler(HttpServletRequest request,Exception ex){
        log.error(ex.getMessage(),ex);
        return ex.getMessage();
    }
}
